package com.zhou.project.modules.system.user.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhou.project.modules.system.user.entity.SysUser;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @project spring-boot-project
 * @author zhouhonggang
 * @datetime 2021/8/11 13:42
 * @version 1.0.0
 * @description: 用户数据层
 */
public interface SysUserDao extends BaseMapper<SysUser> {

    @Select(" select distinct code from system_permissions_info p,system_role_permissions rp where p.id=permissions_id and  role_id in " +
            "(select role_id from system_user_role where user_id=" +
            "(select id from system_user_info where account= #{account}))")
    List<String> queryPermissionsCodeByAccount(String account);

}
